import { request } from "@utils/http/index";
import {Key} from "react"

import type {
    getHosSetListParamsType,
    getHosSetListReturnType,
    getHosSetListItemsType,
    addHosSetParamsType,
    updateHosSetParamsType
} from '@api/hospital/model/hospitalSetTypes'



//医院设置中 获取分页列表
export const getHosSetListRequest = ({ page, limit, hosname, hoscode }:getHosSetListParamsType) => {
    return request.get<any , getHosSetListReturnType>(`/admin/hosp/hospitalSet/${page}/${limit}`,{
        params: {
            hosname,
            hoscode
        }
    })
}


//医院设置中 根据id获取某个医院的详细信息
export const getHosSetFromIDRequest = (id:string) => {
    return request.get<any , getHosSetListItemsType>(`/admin/hosp/hospitalSet/get/${id}`)
}

//医院设置中 添加医院
export const addHosSetRequest = (data:addHosSetParamsType) => {
    return request.post<any , null>("/admin/hosp/hospitalSet/save" , data)
}

//医院设置中 修改医院
export const updateHosSetRequest = (data:updateHosSetParamsType) => {
    return request.put<any , null>("/admin/hosp/hospitalSet/update" , data)
}

//医院设置中 删除医院
export const deleteHosSetRequest = (id:number) => {
    return request.delete<any , null>(`/admin/hosp/hospitalSet/remove/${id}`)
}


//医院设置中 批量删除医院
export const deletaAllHosSetRequest = (ids:Key[]) => {
    return request.delete("/admin/hosp/hospitalSet/batchRemove" , {
        data: ids
    })
}

